** MASTER FILE  **	
	
	*Set constants
	set more off
	global sysdate: display %tdCCYY-NN-DD date(c(current_date), "DMY")
	disp "$sysdate" //date is YMD with hyphens between fields
	
	global basefiles "input\basefiles"
	global input_dir "output_folder"
	global temp_dir "temp"
		
	
	
	global local_folder "local_folder"
	
	
	*Define datasets
	global basefile_teacher "(B1) Teacher Panel 2010 to 2018 (2019-03-05).dta"
	global basefile_observation "(B2) Observation Panel 2010 to 2018 (2019-02-12).dta"
	global basefile_students "(B4) Student Panel 2007 to 2018 (2019-03-06).dta"
	global basefile_studentRoster "(B6) StudentTeacherRoster 2010 to 2018 (2019-02-20).dta"
	
	*Create database
	do "$local_folder\build\01_combine_threat_with_panel.do"

	*Create switch_subj database from Roster
	do "$local_folder\build\02_01_generate_subjswitch.do"
	
		
	* create variables needed for analysis
				
		use "$input_dir\teacher_threat_noiva.dta", clear	
		do "$local_folder\build\02b_clean_and_generate_variables_noiva.do"
		merge 1:1 id year using "$temp_dir\teacher_subject_switching.dta"
		drop _merge
		save "$input_dir\teacher_threat_noiva_withvars.dta", replace
	
	* Create student dataset
	do "$local_folder\build\03_create_student_dataset.do"
	
	* create suspension data
	
	* 1) run this to create suspension data by student by year:
		do "$local_folder\build\04_create_susp_roster.do"
		
	
	XXX
	
	*********************  to create day-by-day data, must run R-CODE  *************************************
	* 2) run the R-Code "function_suspensionDasta". NOTE: This code will only work if 04_create_susp_roster was run!
	
	* 3) THEN run this:
		do "$local_folder\build\code_Version05\04b_create_sus_by_date.do"
	
	
	
	
	
	
	
	
	
	
